﻿@using StripeOne.Blog.Base.Configuration
@model StripeOne.Blog.Models.Partials.DatepickerModel
@{
    var rdn = new Random(DateTime.Now.Millisecond).Next(0, 100);
}
@if (Model.ShowCalendarIcon)
{ 
    <div class="input-append date" id="datepicker@(rdn)" data-date="@(Model.Value)" data-date-format="@(Instances.Current.DateFormat)">
        <input class="span8" id="inputDatepicker@(rdn)" size="20" type="text" name="@(Model.Name)" value="@(Model.Value)" />
        <span class="add-on"><i class="icon-th"></i></span>
    </div> 
}
else
{
    <input class="span8" id="inputDatepicker@(rdn)" size="20" type="text" name="@(Model.Name)" value="@(Model.Value)" />
}
<script type="text/javascript">
    $('input[name="@(Model.Name)"], div#datepicker@(rdn)').datepicker(
    {
        format: '@(Instances.Current.DateFormat)',
        language: '@(Instances.Current.Dictionary)'
    });
</script>
